/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
#include "NoteStore_types.h"

namespace evernote { namespace edam {

const char* SyncState::ascii_fingerprint = "2D37F7155AE775C329078C137087C461";
const uint8_t SyncState::binary_fingerprint[16] = {0x2D,0x37,0xF7,0x15,0x5A,0xE7,0x75,0xC3,0x29,0x07,0x8C,0x13,0x70,0x87,0xC4,0x61};

uint32_t SyncState::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_currentTime = false;
  bool isset_fullSyncBefore = false;
  bool isset_updateCount = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->currentTime);
          isset_currentTime = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->fullSyncBefore);
          isset_fullSyncBefore = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateCount);
          isset_updateCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->uploaded);
          this->__isset.uploaded = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_currentTime)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_fullSyncBefore)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_updateCount)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}

uint32_t SyncState::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("SyncState");
  xfer += oprot->writeFieldBegin("currentTime", ::apache::thrift::protocol::T_I64, 1);
  xfer += oprot->writeI64(this->currentTime);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("fullSyncBefore", ::apache::thrift::protocol::T_I64, 2);
  xfer += oprot->writeI64(this->fullSyncBefore);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("updateCount", ::apache::thrift::protocol::T_I32, 3);
  xfer += oprot->writeI32(this->updateCount);
  xfer += oprot->writeFieldEnd();
  if (this->__isset.uploaded) {
    xfer += oprot->writeFieldBegin("uploaded", ::apache::thrift::protocol::T_I64, 4);
    xfer += oprot->writeI64(this->uploaded);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* SyncChunk::ascii_fingerprint = "6AA62F2CD716D2E20D2225B1A5DE6817";
const uint8_t SyncChunk::binary_fingerprint[16] = {0x6A,0xA6,0x2F,0x2C,0xD7,0x16,0xD2,0xE2,0x0D,0x22,0x25,0xB1,0xA5,0xDE,0x68,0x17};

uint32_t SyncChunk::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_currentTime = false;
  bool isset_updateCount = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->currentTime);
          isset_currentTime = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->chunkHighUSN);
          this->__isset.chunkHighUSN = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateCount);
          isset_updateCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->notes.clear();
            uint32_t _size0;
            ::apache::thrift::protocol::TType _etype3;
            iprot->readListBegin(_etype3, _size0);
            this->notes.resize(_size0);
            uint32_t _i4;
            for (_i4 = 0; _i4 < _size0; ++_i4)
            {
              xfer += this->notes[_i4].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.notes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->notebooks.clear();
            uint32_t _size5;
            ::apache::thrift::protocol::TType _etype8;
            iprot->readListBegin(_etype8, _size5);
            this->notebooks.resize(_size5);
            uint32_t _i9;
            for (_i9 = 0; _i9 < _size5; ++_i9)
            {
              xfer += this->notebooks[_i9].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.notebooks = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->tags.clear();
            uint32_t _size10;
            ::apache::thrift::protocol::TType _etype13;
            iprot->readListBegin(_etype13, _size10);
            this->tags.resize(_size10);
            uint32_t _i14;
            for (_i14 = 0; _i14 < _size10; ++_i14)
            {
              xfer += this->tags[_i14].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.tags = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->searches.clear();
            uint32_t _size15;
            ::apache::thrift::protocol::TType _etype18;
            iprot->readListBegin(_etype18, _size15);
            this->searches.resize(_size15);
            uint32_t _i19;
            for (_i19 = 0; _i19 < _size15; ++_i19)
            {
              xfer += this->searches[_i19].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.searches = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->resources.clear();
            uint32_t _size20;
            ::apache::thrift::protocol::TType _etype23;
            iprot->readListBegin(_etype23, _size20);
            this->resources.resize(_size20);
            uint32_t _i24;
            for (_i24 = 0; _i24 < _size20; ++_i24)
            {
              xfer += this->resources[_i24].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.resources = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->expungedNotes.clear();
            uint32_t _size25;
            ::apache::thrift::protocol::TType _etype28;
            iprot->readListBegin(_etype28, _size25);
            this->expungedNotes.resize(_size25);
            uint32_t _i29;
            for (_i29 = 0; _i29 < _size25; ++_i29)
            {
              xfer += iprot->readString(this->expungedNotes[_i29]);
            }
            iprot->readListEnd();
          }
          this->__isset.expungedNotes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->expungedNotebooks.clear();
            uint32_t _size30;
            ::apache::thrift::protocol::TType _etype33;
            iprot->readListBegin(_etype33, _size30);
            this->expungedNotebooks.resize(_size30);
            uint32_t _i34;
            for (_i34 = 0; _i34 < _size30; ++_i34)
            {
              xfer += iprot->readString(this->expungedNotebooks[_i34]);
            }
            iprot->readListEnd();
          }
          this->__isset.expungedNotebooks = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->expungedTags.clear();
            uint32_t _size35;
            ::apache::thrift::protocol::TType _etype38;
            iprot->readListBegin(_etype38, _size35);
            this->expungedTags.resize(_size35);
            uint32_t _i39;
            for (_i39 = 0; _i39 < _size35; ++_i39)
            {
              xfer += iprot->readString(this->expungedTags[_i39]);
            }
            iprot->readListEnd();
          }
          this->__isset.expungedTags = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->expungedSearches.clear();
            uint32_t _size40;
            ::apache::thrift::protocol::TType _etype43;
            iprot->readListBegin(_etype43, _size40);
            this->expungedSearches.resize(_size40);
            uint32_t _i44;
            for (_i44 = 0; _i44 < _size40; ++_i44)
            {
              xfer += iprot->readString(this->expungedSearches[_i44]);
            }
            iprot->readListEnd();
          }
          this->__isset.expungedSearches = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->linkedNotebooks.clear();
            uint32_t _size45;
            ::apache::thrift::protocol::TType _etype48;
            iprot->readListBegin(_etype48, _size45);
            this->linkedNotebooks.resize(_size45);
            uint32_t _i49;
            for (_i49 = 0; _i49 < _size45; ++_i49)
            {
              xfer += this->linkedNotebooks[_i49].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.linkedNotebooks = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->expungedLinkedNotebooks.clear();
            uint32_t _size50;
            ::apache::thrift::protocol::TType _etype53;
            iprot->readListBegin(_etype53, _size50);
            this->expungedLinkedNotebooks.resize(_size50);
            uint32_t _i54;
            for (_i54 = 0; _i54 < _size50; ++_i54)
            {
              xfer += iprot->readString(this->expungedLinkedNotebooks[_i54]);
            }
            iprot->readListEnd();
          }
          this->__isset.expungedLinkedNotebooks = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_currentTime)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_updateCount)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}

uint32_t SyncChunk::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("SyncChunk");
  xfer += oprot->writeFieldBegin("currentTime", ::apache::thrift::protocol::T_I64, 1);
  xfer += oprot->writeI64(this->currentTime);
  xfer += oprot->writeFieldEnd();
  if (this->__isset.chunkHighUSN) {
    xfer += oprot->writeFieldBegin("chunkHighUSN", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->chunkHighUSN);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldBegin("updateCount", ::apache::thrift::protocol::T_I32, 3);
  xfer += oprot->writeI32(this->updateCount);
  xfer += oprot->writeFieldEnd();
  if (this->__isset.notes) {
    xfer += oprot->writeFieldBegin("notes", ::apache::thrift::protocol::T_LIST, 4);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->notes.size());
      std::vector<evernote::edam::Note> ::const_iterator _iter55;
      for (_iter55 = this->notes.begin(); _iter55 != this->notes.end(); ++_iter55)
      {
        xfer += (*_iter55).write(oprot);
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.notebooks) {
    xfer += oprot->writeFieldBegin("notebooks", ::apache::thrift::protocol::T_LIST, 5);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->notebooks.size());
      std::vector<evernote::edam::Notebook> ::const_iterator _iter56;
      for (_iter56 = this->notebooks.begin(); _iter56 != this->notebooks.end(); ++_iter56)
      {
        xfer += (*_iter56).write(oprot);
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.tags) {
    xfer += oprot->writeFieldBegin("tags", ::apache::thrift::protocol::T_LIST, 6);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->tags.size());
      std::vector<evernote::edam::Tag> ::const_iterator _iter57;
      for (_iter57 = this->tags.begin(); _iter57 != this->tags.end(); ++_iter57)
      {
        xfer += (*_iter57).write(oprot);
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.searches) {
    xfer += oprot->writeFieldBegin("searches", ::apache::thrift::protocol::T_LIST, 7);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->searches.size());
      std::vector<evernote::edam::SavedSearch> ::const_iterator _iter58;
      for (_iter58 = this->searches.begin(); _iter58 != this->searches.end(); ++_iter58)
      {
        xfer += (*_iter58).write(oprot);
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.resources) {
    xfer += oprot->writeFieldBegin("resources", ::apache::thrift::protocol::T_LIST, 8);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->resources.size());
      std::vector<evernote::edam::Resource> ::const_iterator _iter59;
      for (_iter59 = this->resources.begin(); _iter59 != this->resources.end(); ++_iter59)
      {
        xfer += (*_iter59).write(oprot);
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.expungedNotes) {
    xfer += oprot->writeFieldBegin("expungedNotes", ::apache::thrift::protocol::T_LIST, 9);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->expungedNotes.size());
      std::vector<evernote::edam::Guid> ::const_iterator _iter60;
      for (_iter60 = this->expungedNotes.begin(); _iter60 != this->expungedNotes.end(); ++_iter60)
      {
        xfer += oprot->writeString((*_iter60));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.expungedNotebooks) {
    xfer += oprot->writeFieldBegin("expungedNotebooks", ::apache::thrift::protocol::T_LIST, 10);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->expungedNotebooks.size());
      std::vector<evernote::edam::Guid> ::const_iterator _iter61;
      for (_iter61 = this->expungedNotebooks.begin(); _iter61 != this->expungedNotebooks.end(); ++_iter61)
      {
        xfer += oprot->writeString((*_iter61));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.expungedTags) {
    xfer += oprot->writeFieldBegin("expungedTags", ::apache::thrift::protocol::T_LIST, 11);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->expungedTags.size());
      std::vector<evernote::edam::Guid> ::const_iterator _iter62;
      for (_iter62 = this->expungedTags.begin(); _iter62 != this->expungedTags.end(); ++_iter62)
      {
        xfer += oprot->writeString((*_iter62));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.expungedSearches) {
    xfer += oprot->writeFieldBegin("expungedSearches", ::apache::thrift::protocol::T_LIST, 12);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->expungedSearches.size());
      std::vector<evernote::edam::Guid> ::const_iterator _iter63;
      for (_iter63 = this->expungedSearches.begin(); _iter63 != this->expungedSearches.end(); ++_iter63)
      {
        xfer += oprot->writeString((*_iter63));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.linkedNotebooks) {
    xfer += oprot->writeFieldBegin("linkedNotebooks", ::apache::thrift::protocol::T_LIST, 13);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->linkedNotebooks.size());
      std::vector<evernote::edam::LinkedNotebook> ::const_iterator _iter64;
      for (_iter64 = this->linkedNotebooks.begin(); _iter64 != this->linkedNotebooks.end(); ++_iter64)
      {
        xfer += (*_iter64).write(oprot);
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.expungedLinkedNotebooks) {
    xfer += oprot->writeFieldBegin("expungedLinkedNotebooks", ::apache::thrift::protocol::T_LIST, 14);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->expungedLinkedNotebooks.size());
      std::vector<evernote::edam::Guid> ::const_iterator _iter65;
      for (_iter65 = this->expungedLinkedNotebooks.begin(); _iter65 != this->expungedLinkedNotebooks.end(); ++_iter65)
      {
        xfer += oprot->writeString((*_iter65));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* SyncChunkFilter::ascii_fingerprint = "39A6499DBC9F34F8EB10F87E45BE5390";
const uint8_t SyncChunkFilter::binary_fingerprint[16] = {0x39,0xA6,0x49,0x9D,0xBC,0x9F,0x34,0xF8,0xEB,0x10,0xF8,0x7E,0x45,0xBE,0x53,0x90};

uint32_t SyncChunkFilter::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeNotes);
          this->__isset.includeNotes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeNoteResources);
          this->__isset.includeNoteResources = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeNoteAttributes);
          this->__isset.includeNoteAttributes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeNotebooks);
          this->__isset.includeNotebooks = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeTags);
          this->__isset.includeTags = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeSearches);
          this->__isset.includeSearches = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeResources);
          this->__isset.includeResources = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeLinkedNotebooks);
          this->__isset.includeLinkedNotebooks = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeExpunged);
          this->__isset.includeExpunged = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeNoteApplicationDataFullMap);
          this->__isset.includeNoteApplicationDataFullMap = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeResourceApplicationDataFullMap);
          this->__isset.includeResourceApplicationDataFullMap = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeNoteResourceApplicationDataFullMap);
          this->__isset.includeNoteResourceApplicationDataFullMap = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->requireNoteContentClass);
          this->__isset.requireNoteContentClass = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SyncChunkFilter::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("SyncChunkFilter");
  if (this->__isset.includeNotes) {
    xfer += oprot->writeFieldBegin("includeNotes", ::apache::thrift::protocol::T_BOOL, 1);
    xfer += oprot->writeBool(this->includeNotes);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeNoteResources) {
    xfer += oprot->writeFieldBegin("includeNoteResources", ::apache::thrift::protocol::T_BOOL, 2);
    xfer += oprot->writeBool(this->includeNoteResources);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeNoteAttributes) {
    xfer += oprot->writeFieldBegin("includeNoteAttributes", ::apache::thrift::protocol::T_BOOL, 3);
    xfer += oprot->writeBool(this->includeNoteAttributes);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeNotebooks) {
    xfer += oprot->writeFieldBegin("includeNotebooks", ::apache::thrift::protocol::T_BOOL, 4);
    xfer += oprot->writeBool(this->includeNotebooks);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeTags) {
    xfer += oprot->writeFieldBegin("includeTags", ::apache::thrift::protocol::T_BOOL, 5);
    xfer += oprot->writeBool(this->includeTags);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeSearches) {
    xfer += oprot->writeFieldBegin("includeSearches", ::apache::thrift::protocol::T_BOOL, 6);
    xfer += oprot->writeBool(this->includeSearches);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeResources) {
    xfer += oprot->writeFieldBegin("includeResources", ::apache::thrift::protocol::T_BOOL, 7);
    xfer += oprot->writeBool(this->includeResources);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeLinkedNotebooks) {
    xfer += oprot->writeFieldBegin("includeLinkedNotebooks", ::apache::thrift::protocol::T_BOOL, 8);
    xfer += oprot->writeBool(this->includeLinkedNotebooks);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeExpunged) {
    xfer += oprot->writeFieldBegin("includeExpunged", ::apache::thrift::protocol::T_BOOL, 9);
    xfer += oprot->writeBool(this->includeExpunged);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeNoteApplicationDataFullMap) {
    xfer += oprot->writeFieldBegin("includeNoteApplicationDataFullMap", ::apache::thrift::protocol::T_BOOL, 10);
    xfer += oprot->writeBool(this->includeNoteApplicationDataFullMap);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.requireNoteContentClass) {
    xfer += oprot->writeFieldBegin("requireNoteContentClass", ::apache::thrift::protocol::T_STRING, 11);
    xfer += oprot->writeString(this->requireNoteContentClass);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeResourceApplicationDataFullMap) {
    xfer += oprot->writeFieldBegin("includeResourceApplicationDataFullMap", ::apache::thrift::protocol::T_BOOL, 12);
    xfer += oprot->writeBool(this->includeResourceApplicationDataFullMap);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeNoteResourceApplicationDataFullMap) {
    xfer += oprot->writeFieldBegin("includeNoteResourceApplicationDataFullMap", ::apache::thrift::protocol::T_BOOL, 13);
    xfer += oprot->writeBool(this->includeNoteResourceApplicationDataFullMap);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NoteFilter::ascii_fingerprint = "E3FEA280E924E0A51D5D872FA8A51D7F";
const uint8_t NoteFilter::binary_fingerprint[16] = {0xE3,0xFE,0xA2,0x80,0xE9,0x24,0xE0,0xA5,0x1D,0x5D,0x87,0x2F,0xA8,0xA5,0x1D,0x7F};

uint32_t NoteFilter::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->order);
          this->__isset.order = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->ascending);
          this->__isset.ascending = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->words);
          this->__isset.words = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->notebookGuid);
          this->__isset.notebookGuid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->tagGuids.clear();
            uint32_t _size66;
            ::apache::thrift::protocol::TType _etype69;
            iprot->readListBegin(_etype69, _size66);
            this->tagGuids.resize(_size66);
            uint32_t _i70;
            for (_i70 = 0; _i70 < _size66; ++_i70)
            {
              xfer += iprot->readString(this->tagGuids[_i70]);
            }
            iprot->readListEnd();
          }
          this->__isset.tagGuids = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->timeZone);
          this->__isset.timeZone = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->inactive);
          this->__isset.inactive = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t NoteFilter::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NoteFilter");
  if (this->__isset.order) {
    xfer += oprot->writeFieldBegin("order", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32(this->order);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.ascending) {
    xfer += oprot->writeFieldBegin("ascending", ::apache::thrift::protocol::T_BOOL, 2);
    xfer += oprot->writeBool(this->ascending);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.words) {
    xfer += oprot->writeFieldBegin("words", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeString(this->words);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.notebookGuid) {
    xfer += oprot->writeFieldBegin("notebookGuid", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeString(this->notebookGuid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.tagGuids) {
    xfer += oprot->writeFieldBegin("tagGuids", ::apache::thrift::protocol::T_LIST, 5);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->tagGuids.size());
      std::vector<evernote::edam::Guid> ::const_iterator _iter71;
      for (_iter71 = this->tagGuids.begin(); _iter71 != this->tagGuids.end(); ++_iter71)
      {
        xfer += oprot->writeString((*_iter71));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.timeZone) {
    xfer += oprot->writeFieldBegin("timeZone", ::apache::thrift::protocol::T_STRING, 6);
    xfer += oprot->writeString(this->timeZone);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.inactive) {
    xfer += oprot->writeFieldBegin("inactive", ::apache::thrift::protocol::T_BOOL, 7);
    xfer += oprot->writeBool(this->inactive);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NoteList::ascii_fingerprint = "EA547BD5E9E15BC9B3FC3DCFA10676B3";
const uint8_t NoteList::binary_fingerprint[16] = {0xEA,0x54,0x7B,0xD5,0xE9,0xE1,0x5B,0xC9,0xB3,0xFC,0x3D,0xCF,0xA1,0x06,0x76,0xB3};

uint32_t NoteList::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_startIndex = false;
  bool isset_totalNotes = false;
  bool isset_notes = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->startIndex);
          isset_startIndex = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->totalNotes);
          isset_totalNotes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->notes.clear();
            uint32_t _size72;
            ::apache::thrift::protocol::TType _etype75;
            iprot->readListBegin(_etype75, _size72);
            this->notes.resize(_size72);
            uint32_t _i76;
            for (_i76 = 0; _i76 < _size72; ++_i76)
            {
              xfer += this->notes[_i76].read(iprot);
            }
            iprot->readListEnd();
          }
          isset_notes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->stoppedWords.clear();
            uint32_t _size77;
            ::apache::thrift::protocol::TType _etype80;
            iprot->readListBegin(_etype80, _size77);
            this->stoppedWords.resize(_size77);
            uint32_t _i81;
            for (_i81 = 0; _i81 < _size77; ++_i81)
            {
              xfer += iprot->readString(this->stoppedWords[_i81]);
            }
            iprot->readListEnd();
          }
          this->__isset.stoppedWords = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->searchedWords.clear();
            uint32_t _size82;
            ::apache::thrift::protocol::TType _etype85;
            iprot->readListBegin(_etype85, _size82);
            this->searchedWords.resize(_size82);
            uint32_t _i86;
            for (_i86 = 0; _i86 < _size82; ++_i86)
            {
              xfer += iprot->readString(this->searchedWords[_i86]);
            }
            iprot->readListEnd();
          }
          this->__isset.searchedWords = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateCount);
          this->__isset.updateCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_startIndex)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_totalNotes)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_notes)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}

uint32_t NoteList::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NoteList");
  xfer += oprot->writeFieldBegin("startIndex", ::apache::thrift::protocol::T_I32, 1);
  xfer += oprot->writeI32(this->startIndex);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("totalNotes", ::apache::thrift::protocol::T_I32, 2);
  xfer += oprot->writeI32(this->totalNotes);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("notes", ::apache::thrift::protocol::T_LIST, 3);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->notes.size());
    std::vector<evernote::edam::Note> ::const_iterator _iter87;
    for (_iter87 = this->notes.begin(); _iter87 != this->notes.end(); ++_iter87)
    {
      xfer += (*_iter87).write(oprot);
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();
  if (this->__isset.stoppedWords) {
    xfer += oprot->writeFieldBegin("stoppedWords", ::apache::thrift::protocol::T_LIST, 4);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->stoppedWords.size());
      std::vector<std::string> ::const_iterator _iter88;
      for (_iter88 = this->stoppedWords.begin(); _iter88 != this->stoppedWords.end(); ++_iter88)
      {
        xfer += oprot->writeString((*_iter88));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.searchedWords) {
    xfer += oprot->writeFieldBegin("searchedWords", ::apache::thrift::protocol::T_LIST, 5);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->searchedWords.size());
      std::vector<std::string> ::const_iterator _iter89;
      for (_iter89 = this->searchedWords.begin(); _iter89 != this->searchedWords.end(); ++_iter89)
      {
        xfer += oprot->writeString((*_iter89));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateCount) {
    xfer += oprot->writeFieldBegin("updateCount", ::apache::thrift::protocol::T_I32, 6);
    xfer += oprot->writeI32(this->updateCount);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NoteMetadata::ascii_fingerprint = "49B4E2C64AD1B5A204860B68F0C99800";
const uint8_t NoteMetadata::binary_fingerprint[16] = {0x49,0xB4,0xE2,0xC6,0x4A,0xD1,0xB5,0xA2,0x04,0x86,0x0B,0x68,0xF0,0xC9,0x98,0x00};

uint32_t NoteMetadata::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_guid = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->guid);
          isset_guid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->title);
          this->__isset.title = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->contentLength);
          this->__isset.contentLength = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->created);
          this->__isset.created = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->updated);
          this->__isset.updated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateSequenceNum);
          this->__isset.updateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->notebookGuid);
          this->__isset.notebookGuid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->tagGuids.clear();
            uint32_t _size90;
            ::apache::thrift::protocol::TType _etype93;
            iprot->readListBegin(_etype93, _size90);
            this->tagGuids.resize(_size90);
            uint32_t _i94;
            for (_i94 = 0; _i94 < _size90; ++_i94)
            {
              xfer += iprot->readString(this->tagGuids[_i94]);
            }
            iprot->readListEnd();
          }
          this->__isset.tagGuids = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->attributes.read(iprot);
          this->__isset.attributes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 20:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->largestResourceMime);
          this->__isset.largestResourceMime = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 21:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->largestResourceSize);
          this->__isset.largestResourceSize = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_guid)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}

uint32_t NoteMetadata::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NoteMetadata");
  xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeString(this->guid);
  xfer += oprot->writeFieldEnd();
  if (this->__isset.title) {
    xfer += oprot->writeFieldBegin("title", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->title);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.contentLength) {
    xfer += oprot->writeFieldBegin("contentLength", ::apache::thrift::protocol::T_I32, 5);
    xfer += oprot->writeI32(this->contentLength);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.created) {
    xfer += oprot->writeFieldBegin("created", ::apache::thrift::protocol::T_I64, 6);
    xfer += oprot->writeI64(this->created);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updated) {
    xfer += oprot->writeFieldBegin("updated", ::apache::thrift::protocol::T_I64, 7);
    xfer += oprot->writeI64(this->updated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateSequenceNum) {
    xfer += oprot->writeFieldBegin("updateSequenceNum", ::apache::thrift::protocol::T_I32, 10);
    xfer += oprot->writeI32(this->updateSequenceNum);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.notebookGuid) {
    xfer += oprot->writeFieldBegin("notebookGuid", ::apache::thrift::protocol::T_STRING, 11);
    xfer += oprot->writeString(this->notebookGuid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.tagGuids) {
    xfer += oprot->writeFieldBegin("tagGuids", ::apache::thrift::protocol::T_LIST, 12);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->tagGuids.size());
      std::vector<evernote::edam::Guid> ::const_iterator _iter95;
      for (_iter95 = this->tagGuids.begin(); _iter95 != this->tagGuids.end(); ++_iter95)
      {
        xfer += oprot->writeString((*_iter95));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.attributes) {
    xfer += oprot->writeFieldBegin("attributes", ::apache::thrift::protocol::T_STRUCT, 14);
    xfer += this->attributes.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.largestResourceMime) {
    xfer += oprot->writeFieldBegin("largestResourceMime", ::apache::thrift::protocol::T_STRING, 20);
    xfer += oprot->writeString(this->largestResourceMime);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.largestResourceSize) {
    xfer += oprot->writeFieldBegin("largestResourceSize", ::apache::thrift::protocol::T_I32, 21);
    xfer += oprot->writeI32(this->largestResourceSize);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NotesMetadataList::ascii_fingerprint = "12D728A0A4D9583C54353A4D3AF9DD79";
const uint8_t NotesMetadataList::binary_fingerprint[16] = {0x12,0xD7,0x28,0xA0,0xA4,0xD9,0x58,0x3C,0x54,0x35,0x3A,0x4D,0x3A,0xF9,0xDD,0x79};

uint32_t NotesMetadataList::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_startIndex = false;
  bool isset_totalNotes = false;
  bool isset_notes = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->startIndex);
          isset_startIndex = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->totalNotes);
          isset_totalNotes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->notes.clear();
            uint32_t _size96;
            ::apache::thrift::protocol::TType _etype99;
            iprot->readListBegin(_etype99, _size96);
            this->notes.resize(_size96);
            uint32_t _i100;
            for (_i100 = 0; _i100 < _size96; ++_i100)
            {
              xfer += this->notes[_i100].read(iprot);
            }
            iprot->readListEnd();
          }
          isset_notes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->stoppedWords.clear();
            uint32_t _size101;
            ::apache::thrift::protocol::TType _etype104;
            iprot->readListBegin(_etype104, _size101);
            this->stoppedWords.resize(_size101);
            uint32_t _i105;
            for (_i105 = 0; _i105 < _size101; ++_i105)
            {
              xfer += iprot->readString(this->stoppedWords[_i105]);
            }
            iprot->readListEnd();
          }
          this->__isset.stoppedWords = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->searchedWords.clear();
            uint32_t _size106;
            ::apache::thrift::protocol::TType _etype109;
            iprot->readListBegin(_etype109, _size106);
            this->searchedWords.resize(_size106);
            uint32_t _i110;
            for (_i110 = 0; _i110 < _size106; ++_i110)
            {
              xfer += iprot->readString(this->searchedWords[_i110]);
            }
            iprot->readListEnd();
          }
          this->__isset.searchedWords = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateCount);
          this->__isset.updateCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_startIndex)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_totalNotes)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_notes)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}

uint32_t NotesMetadataList::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NotesMetadataList");
  xfer += oprot->writeFieldBegin("startIndex", ::apache::thrift::protocol::T_I32, 1);
  xfer += oprot->writeI32(this->startIndex);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("totalNotes", ::apache::thrift::protocol::T_I32, 2);
  xfer += oprot->writeI32(this->totalNotes);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("notes", ::apache::thrift::protocol::T_LIST, 3);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->notes.size());
    std::vector<NoteMetadata> ::const_iterator _iter111;
    for (_iter111 = this->notes.begin(); _iter111 != this->notes.end(); ++_iter111)
    {
      xfer += (*_iter111).write(oprot);
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();
  if (this->__isset.stoppedWords) {
    xfer += oprot->writeFieldBegin("stoppedWords", ::apache::thrift::protocol::T_LIST, 4);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->stoppedWords.size());
      std::vector<std::string> ::const_iterator _iter112;
      for (_iter112 = this->stoppedWords.begin(); _iter112 != this->stoppedWords.end(); ++_iter112)
      {
        xfer += oprot->writeString((*_iter112));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.searchedWords) {
    xfer += oprot->writeFieldBegin("searchedWords", ::apache::thrift::protocol::T_LIST, 5);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->searchedWords.size());
      std::vector<std::string> ::const_iterator _iter113;
      for (_iter113 = this->searchedWords.begin(); _iter113 != this->searchedWords.end(); ++_iter113)
      {
        xfer += oprot->writeString((*_iter113));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateCount) {
    xfer += oprot->writeFieldBegin("updateCount", ::apache::thrift::protocol::T_I32, 6);
    xfer += oprot->writeI32(this->updateCount);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NotesMetadataResultSpec::ascii_fingerprint = "76B8B38B98B51F67027A0B456AD81520";
const uint8_t NotesMetadataResultSpec::binary_fingerprint[16] = {0x76,0xB8,0xB3,0x8B,0x98,0xB5,0x1F,0x67,0x02,0x7A,0x0B,0x45,0x6A,0xD8,0x15,0x20};

uint32_t NotesMetadataResultSpec::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 2:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeTitle);
          this->__isset.includeTitle = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeContentLength);
          this->__isset.includeContentLength = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeCreated);
          this->__isset.includeCreated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeUpdated);
          this->__isset.includeUpdated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeUpdateSequenceNum);
          this->__isset.includeUpdateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeNotebookGuid);
          this->__isset.includeNotebookGuid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeTagGuids);
          this->__isset.includeTagGuids = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeAttributes);
          this->__isset.includeAttributes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 20:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeLargestResourceMime);
          this->__isset.includeLargestResourceMime = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 21:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->includeLargestResourceSize);
          this->__isset.includeLargestResourceSize = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t NotesMetadataResultSpec::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NotesMetadataResultSpec");
  if (this->__isset.includeTitle) {
    xfer += oprot->writeFieldBegin("includeTitle", ::apache::thrift::protocol::T_BOOL, 2);
    xfer += oprot->writeBool(this->includeTitle);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeContentLength) {
    xfer += oprot->writeFieldBegin("includeContentLength", ::apache::thrift::protocol::T_BOOL, 5);
    xfer += oprot->writeBool(this->includeContentLength);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeCreated) {
    xfer += oprot->writeFieldBegin("includeCreated", ::apache::thrift::protocol::T_BOOL, 6);
    xfer += oprot->writeBool(this->includeCreated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeUpdated) {
    xfer += oprot->writeFieldBegin("includeUpdated", ::apache::thrift::protocol::T_BOOL, 7);
    xfer += oprot->writeBool(this->includeUpdated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeUpdateSequenceNum) {
    xfer += oprot->writeFieldBegin("includeUpdateSequenceNum", ::apache::thrift::protocol::T_BOOL, 10);
    xfer += oprot->writeBool(this->includeUpdateSequenceNum);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeNotebookGuid) {
    xfer += oprot->writeFieldBegin("includeNotebookGuid", ::apache::thrift::protocol::T_BOOL, 11);
    xfer += oprot->writeBool(this->includeNotebookGuid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeTagGuids) {
    xfer += oprot->writeFieldBegin("includeTagGuids", ::apache::thrift::protocol::T_BOOL, 12);
    xfer += oprot->writeBool(this->includeTagGuids);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeAttributes) {
    xfer += oprot->writeFieldBegin("includeAttributes", ::apache::thrift::protocol::T_BOOL, 14);
    xfer += oprot->writeBool(this->includeAttributes);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeLargestResourceMime) {
    xfer += oprot->writeFieldBegin("includeLargestResourceMime", ::apache::thrift::protocol::T_BOOL, 20);
    xfer += oprot->writeBool(this->includeLargestResourceMime);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.includeLargestResourceSize) {
    xfer += oprot->writeFieldBegin("includeLargestResourceSize", ::apache::thrift::protocol::T_BOOL, 21);
    xfer += oprot->writeBool(this->includeLargestResourceSize);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NoteCollectionCounts::ascii_fingerprint = "4A4A773E0979C92FFBF7D8D9EE2AB6F9";
const uint8_t NoteCollectionCounts::binary_fingerprint[16] = {0x4A,0x4A,0x77,0x3E,0x09,0x79,0xC9,0x2F,0xFB,0xF7,0xD8,0xD9,0xEE,0x2A,0xB6,0xF9};

uint32_t NoteCollectionCounts::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_MAP) {
          {
            this->notebookCounts.clear();
            uint32_t _size114;
            ::apache::thrift::protocol::TType _ktype115;
            ::apache::thrift::protocol::TType _vtype116;
            iprot->readMapBegin(_ktype115, _vtype116, _size114);
            uint32_t _i118;
            for (_i118 = 0; _i118 < _size114; ++_i118)
            {
              evernote::edam::Guid _key119;
              xfer += iprot->readString(_key119);
              int32_t& _val120 = this->notebookCounts[_key119];
              xfer += iprot->readI32(_val120);
            }
            iprot->readMapEnd();
          }
          this->__isset.notebookCounts = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_MAP) {
          {
            this->tagCounts.clear();
            uint32_t _size121;
            ::apache::thrift::protocol::TType _ktype122;
            ::apache::thrift::protocol::TType _vtype123;
            iprot->readMapBegin(_ktype122, _vtype123, _size121);
            uint32_t _i125;
            for (_i125 = 0; _i125 < _size121; ++_i125)
            {
              evernote::edam::Guid _key126;
              xfer += iprot->readString(_key126);
              int32_t& _val127 = this->tagCounts[_key126];
              xfer += iprot->readI32(_val127);
            }
            iprot->readMapEnd();
          }
          this->__isset.tagCounts = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->trashCount);
          this->__isset.trashCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t NoteCollectionCounts::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NoteCollectionCounts");
  if (this->__isset.notebookCounts) {
    xfer += oprot->writeFieldBegin("notebookCounts", ::apache::thrift::protocol::T_MAP, 1);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, this->notebookCounts.size());
      std::map<evernote::edam::Guid, int32_t> ::const_iterator _iter128;
      for (_iter128 = this->notebookCounts.begin(); _iter128 != this->notebookCounts.end(); ++_iter128)
      {
        xfer += oprot->writeString(_iter128->first);
        xfer += oprot->writeI32(_iter128->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.tagCounts) {
    xfer += oprot->writeFieldBegin("tagCounts", ::apache::thrift::protocol::T_MAP, 2);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, this->tagCounts.size());
      std::map<evernote::edam::Guid, int32_t> ::const_iterator _iter129;
      for (_iter129 = this->tagCounts.begin(); _iter129 != this->tagCounts.end(); ++_iter129)
      {
        xfer += oprot->writeString(_iter129->first);
        xfer += oprot->writeI32(_iter129->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.trashCount) {
    xfer += oprot->writeFieldBegin("trashCount", ::apache::thrift::protocol::T_I32, 3);
    xfer += oprot->writeI32(this->trashCount);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* AdImpressions::ascii_fingerprint = "6435B39C87AB0E30F30BEDEFD7328C0D";
const uint8_t AdImpressions::binary_fingerprint[16] = {0x64,0x35,0xB3,0x9C,0x87,0xAB,0x0E,0x30,0xF3,0x0B,0xED,0xEF,0xD7,0x32,0x8C,0x0D};

uint32_t AdImpressions::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_adId = false;
  bool isset_impressionCount = false;
  bool isset_impressionTime = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->adId);
          isset_adId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->impressionCount);
          isset_impressionCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->impressionTime);
          isset_impressionTime = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_adId)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_impressionCount)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_impressionTime)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}

uint32_t AdImpressions::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("AdImpressions");
  xfer += oprot->writeFieldBegin("adId", ::apache::thrift::protocol::T_I32, 1);
  xfer += oprot->writeI32(this->adId);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("impressionCount", ::apache::thrift::protocol::T_I32, 2);
  xfer += oprot->writeI32(this->impressionCount);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("impressionTime", ::apache::thrift::protocol::T_I32, 3);
  xfer += oprot->writeI32(this->impressionTime);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* AdParameters::ascii_fingerprint = "E18D1AB8E98004C28B4CF16AA27309AA";
const uint8_t AdParameters::binary_fingerprint[16] = {0xE1,0x8D,0x1A,0xB8,0xE9,0x80,0x04,0xC2,0x8B,0x4C,0xF1,0x6A,0xA2,0x73,0x09,0xAA};

uint32_t AdParameters::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->clientLanguage);
          this->__isset.clientLanguage = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->impressions.clear();
            uint32_t _size130;
            ::apache::thrift::protocol::TType _etype133;
            iprot->readListBegin(_etype133, _size130);
            this->impressions.resize(_size130);
            uint32_t _i134;
            for (_i134 = 0; _i134 < _size130; ++_i134)
            {
              xfer += this->impressions[_i134].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.impressions = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->supportHtml);
          this->__isset.supportHtml = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_MAP) {
          {
            this->clientProperties.clear();
            uint32_t _size135;
            ::apache::thrift::protocol::TType _ktype136;
            ::apache::thrift::protocol::TType _vtype137;
            iprot->readMapBegin(_ktype136, _vtype137, _size135);
            uint32_t _i139;
            for (_i139 = 0; _i139 < _size135; ++_i139)
            {
              std::string _key140;
              xfer += iprot->readString(_key140);
              std::string& _val141 = this->clientProperties[_key140];
              xfer += iprot->readString(_val141);
            }
            iprot->readMapEnd();
          }
          this->__isset.clientProperties = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t AdParameters::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("AdParameters");
  if (this->__isset.clientLanguage) {
    xfer += oprot->writeFieldBegin("clientLanguage", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->clientLanguage);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.impressions) {
    xfer += oprot->writeFieldBegin("impressions", ::apache::thrift::protocol::T_LIST, 4);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->impressions.size());
      std::vector<AdImpressions> ::const_iterator _iter142;
      for (_iter142 = this->impressions.begin(); _iter142 != this->impressions.end(); ++_iter142)
      {
        xfer += (*_iter142).write(oprot);
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.supportHtml) {
    xfer += oprot->writeFieldBegin("supportHtml", ::apache::thrift::protocol::T_BOOL, 5);
    xfer += oprot->writeBool(this->supportHtml);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.clientProperties) {
    xfer += oprot->writeFieldBegin("clientProperties", ::apache::thrift::protocol::T_MAP, 6);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, this->clientProperties.size());
      std::map<std::string, std::string> ::const_iterator _iter143;
      for (_iter143 = this->clientProperties.begin(); _iter143 != this->clientProperties.end(); ++_iter143)
      {
        xfer += oprot->writeString(_iter143->first);
        xfer += oprot->writeString(_iter143->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NoteEmailParameters::ascii_fingerprint = "F3C0D8338D013302A98FD285189E2E6B";
const uint8_t NoteEmailParameters::binary_fingerprint[16] = {0xF3,0xC0,0xD8,0x33,0x8D,0x01,0x33,0x02,0xA9,0x8F,0xD2,0x85,0x18,0x9E,0x2E,0x6B};

uint32_t NoteEmailParameters::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->guid);
          this->__isset.guid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->note.read(iprot);
          this->__isset.note = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->toAddresses.clear();
            uint32_t _size144;
            ::apache::thrift::protocol::TType _etype147;
            iprot->readListBegin(_etype147, _size144);
            this->toAddresses.resize(_size144);
            uint32_t _i148;
            for (_i148 = 0; _i148 < _size144; ++_i148)
            {
              xfer += iprot->readString(this->toAddresses[_i148]);
            }
            iprot->readListEnd();
          }
          this->__isset.toAddresses = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->ccAddresses.clear();
            uint32_t _size149;
            ::apache::thrift::protocol::TType _etype152;
            iprot->readListBegin(_etype152, _size149);
            this->ccAddresses.resize(_size149);
            uint32_t _i153;
            for (_i153 = 0; _i153 < _size149; ++_i153)
            {
              xfer += iprot->readString(this->ccAddresses[_i153]);
            }
            iprot->readListEnd();
          }
          this->__isset.ccAddresses = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->subject);
          this->__isset.subject = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->message);
          this->__isset.message = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t NoteEmailParameters::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NoteEmailParameters");
  if (this->__isset.guid) {
    xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->guid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.note) {
    xfer += oprot->writeFieldBegin("note", ::apache::thrift::protocol::T_STRUCT, 2);
    xfer += this->note.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.toAddresses) {
    xfer += oprot->writeFieldBegin("toAddresses", ::apache::thrift::protocol::T_LIST, 3);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->toAddresses.size());
      std::vector<std::string> ::const_iterator _iter154;
      for (_iter154 = this->toAddresses.begin(); _iter154 != this->toAddresses.end(); ++_iter154)
      {
        xfer += oprot->writeString((*_iter154));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.ccAddresses) {
    xfer += oprot->writeFieldBegin("ccAddresses", ::apache::thrift::protocol::T_LIST, 4);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->ccAddresses.size());
      std::vector<std::string> ::const_iterator _iter155;
      for (_iter155 = this->ccAddresses.begin(); _iter155 != this->ccAddresses.end(); ++_iter155)
      {
        xfer += oprot->writeString((*_iter155));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.subject) {
    xfer += oprot->writeFieldBegin("subject", ::apache::thrift::protocol::T_STRING, 5);
    xfer += oprot->writeString(this->subject);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.message) {
    xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 6);
    xfer += oprot->writeString(this->message);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NoteVersionId::ascii_fingerprint = "D794A4D314465A1EC7A44F1EEE802646";
const uint8_t NoteVersionId::binary_fingerprint[16] = {0xD7,0x94,0xA4,0xD3,0x14,0x46,0x5A,0x1E,0xC7,0xA4,0x4F,0x1E,0xEE,0x80,0x26,0x46};

uint32_t NoteVersionId::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_updateSequenceNum = false;
  bool isset_updated = false;
  bool isset_saved = false;
  bool isset_title = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateSequenceNum);
          isset_updateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->updated);
          isset_updated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->saved);
          isset_saved = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->title);
          isset_title = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_updateSequenceNum)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_updated)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_saved)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  if (!isset_title)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}

uint32_t NoteVersionId::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NoteVersionId");
  xfer += oprot->writeFieldBegin("updateSequenceNum", ::apache::thrift::protocol::T_I32, 1);
  xfer += oprot->writeI32(this->updateSequenceNum);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("updated", ::apache::thrift::protocol::T_I64, 2);
  xfer += oprot->writeI64(this->updated);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("saved", ::apache::thrift::protocol::T_I64, 3);
  xfer += oprot->writeI64(this->saved);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldBegin("title", ::apache::thrift::protocol::T_STRING, 4);
  xfer += oprot->writeString(this->title);
  xfer += oprot->writeFieldEnd();
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

}} // namespace
